package com.itheima.common;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadF {
    /**
     * 创建线程储存管理
     */
    private static ThreadLocal<Long> longThreadLocal = new ThreadLocal<>();

    /**
     * 添加当前线程里的数据id
     * @param id
     */
    public static void setCurrentId(Long id) {
       // log.info("存储当前线程信息");
        longThreadLocal.set(id);
    }

    /**
     * 获取
     * @return
     */
    public static Long getCurrentId() {
      //  log.info("获取当前线程内信息");
        return longThreadLocal.get();

    }
}
